home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-04-14 | 1.3 KB | 48 lines | [TEXT/MPS ] |
- //----------------------------------------------------------------------------------------
- // DefaultCreateTidyHeap_AC.cp
- // Copyright © 1985-97 by Apple Computer, Inc. All rights reserved.
- //----------------------------------------------------------------------------------------
-
- /*
- Change History:
- 04/14/97 mwf First Check in.
- */
-
- // Usage Note:
- // Do not include this file in your project if you define your own 'CreateTidyHeap',
- // or if you are using TidyHeap with MacApp. This file is provided for folks who
- // are using TidyHeap in their own framework, project or whatever. More than likely
- // you'll want to use this file as a template for hooking TidyHeap into your
- // own memory management scheme.
-
- #if qTidyHeap
-
- #ifndef __CTidyHeap_AC__
- #include "CTidyHeap_AC.h"
- #endif
-
- #ifndef __MEMORY__
- #include <Memory.h>
- #endif
-
- //----------------------------------------------------------------------------------------
- // CreateTidyHeap
- //----------------------------------------------------------------------------------------
-
- inline void* NewPtrGlue_AC(unsigned long inSize)
- {
- return ::NewPtr(inSize);
- }
- inline void DisposePtrGlue_AC(void* inPtr)
- {
- ::DisposePtr( (char*) inPtr);
- }
- CTidyHeap_AC* CreateTidyHeap()
- {
- CTidyHeap_AC::GlobalNew = NewPtrGlue_AC;
- CTidyHeap_AC::GlobalDelete = DisposePtrGlue_AC;
- return TH_new CTidyHeap_AC;
- }
-
- #endif
-